package cn.gson.springboot.model.pojos;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.sql.Date;
import java.sql.Time;
import java.util.Objects;

@Entity
@Table(name = "customerservice_", schema = "crm")
public class Customerservice {
    private int serviceId;
    private String serviceTheme;
    private Integer serviceType;
    private Integer serviceWay;
    private Date serviceStartDate;
    private Time serviceStartTime;
    private Integer serviceCostTime;
    private Integer serviceState;
    private String serviceContent;
    private String serviceFeedback;
    private String serviceRemarks;
    private String serviceCustomerName;
    private Employee employeeByEmpId;
    private Customer customerByCustomerId;

    @Id
    @Column(name = "service_id", nullable = false)
    public int getServiceId() {
        return serviceId;
    }

    public void setServiceId(int serviceId) {
        this.serviceId = serviceId;
    }


    @Basic
    @Column(name = "service_theme", nullable = true, length = 255)
    public String getServiceTheme() {
        return serviceTheme;
    }

    public void setServiceTheme(String serviceTheme) {
        this.serviceTheme = serviceTheme;
    }

    @Basic
    @Column(name = "service_type", nullable = true)
    public Integer getServiceType() {
        return serviceType;
    }

    public void setServiceType(Integer serviceType) {
        this.serviceType = serviceType;
    }

    @Basic
    @Column(name = "service_way", nullable = true)
    public Integer getServiceWay() {
        return serviceWay;
    }

    public void setServiceWay(Integer serviceWay) {
        this.serviceWay = serviceWay;
    }

    @Basic
    @Column(name = "service_start_date", nullable = true)
    public Date getServiceStartDate() {
        return serviceStartDate;
    }

    public void setServiceStartDate(Date serviceStartDate) {
        this.serviceStartDate = serviceStartDate;
    }

    @Basic
    @Column(name = "service_start_time", nullable = true)
    public Time getServiceStartTime() {
        return serviceStartTime;
    }

    public void setServiceStartTime(Time serviceStartTime) {
        this.serviceStartTime = serviceStartTime;
    }

    @Basic
    @Column(name = "service_cost_time", nullable = true)
    public Integer getServiceCostTime() {
        return serviceCostTime;
    }

    public void setServiceCostTime(Integer serviceCostTime) {
        this.serviceCostTime = serviceCostTime;
    }

    @Basic
    @Column(name = "service_state", nullable = true)
    public Integer getServiceState() {
        return serviceState;
    }

    public void setServiceState(Integer serviceState) {
        this.serviceState = serviceState;
    }

    @Basic
    @Column(name = "service_content", nullable = true, length = 255)
    public String getServiceContent() {
        return serviceContent;
    }

    public void setServiceContent(String serviceContent) {
        this.serviceContent = serviceContent;
    }

    @Basic
    @Column(name = "service_feedback", nullable = true, length = 255)
    public String getServiceFeedback() {
        return serviceFeedback;
    }

    public void setServiceFeedback(String serviceFeedback) {
        this.serviceFeedback = serviceFeedback;
    }

    @Basic
    @Column(name = "service_remarks", nullable = true, length = 255)
    public String getServiceRemarks() {
        return serviceRemarks;
    }

    public void setServiceRemarks(String serviceRemarks) {
        this.serviceRemarks = serviceRemarks;
    }

    @Basic
    @Column(name = "service_customer_name", nullable = true, length = 255)
    public String getServiceCustomerName() {
        return serviceCustomerName;
    }

    public void setServiceCustomerName(String serviceCustomerName) {
        this.serviceCustomerName = serviceCustomerName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customerservice that = (Customerservice) o;
        return serviceId == that.serviceId &&
                Objects.equals(serviceTheme, that.serviceTheme) &&
                Objects.equals(serviceType, that.serviceType) &&
                Objects.equals(serviceWay, that.serviceWay) &&
                Objects.equals(serviceStartDate, that.serviceStartDate) &&
                Objects.equals(serviceStartTime, that.serviceStartTime) &&
                Objects.equals(serviceCostTime, that.serviceCostTime) &&
                Objects.equals(serviceState, that.serviceState) &&
                Objects.equals(serviceContent, that.serviceContent) &&
                Objects.equals(serviceFeedback, that.serviceFeedback) &&
                Objects.equals(serviceRemarks, that.serviceRemarks) &&
                Objects.equals(serviceCustomerName, that.serviceCustomerName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(serviceId, serviceTheme, serviceType, serviceWay, serviceStartDate, serviceStartTime, serviceCostTime, serviceState, serviceContent, serviceFeedback, serviceRemarks, serviceCustomerName);
    }

    @ManyToOne
    @JoinColumn(name = "emp_id", referencedColumnName = "emp_id")
    public Employee getEmployeeByEmpId() {
        return employeeByEmpId;
    }

    public void setEmployeeByEmpId(Employee employeeByEmpId) {
        this.employeeByEmpId = employeeByEmpId;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }
}
